#ifndef MYMODEL_H
#define MYMODEL_H

#include <QAbstractTableModel>
#include <QDebug>
#include <QFont>
#include <QBrush>
#include <QTimer>
#include <QTime>

const int   COLS = 3;
const int   ROWS = 4;

class MyModel : public QAbstractTableModel
{
    Q_OBJECT
    QTimer  *timer;
    QString m_gridData[ROWS][COLS]; /// store our data
public:
    MyModel(QObject *parent = 0);
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    int columnCount(const QModelIndex &parent = QModelIndex()) const;
    QVariant    data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    QVariant    headerData(int section, Qt::Orientation orientation, int role) const;
    bool        setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
    Qt::ItemFlags   flags(const QModelIndex &index) const;
    
signals:
    void    editCompleted(const QString &); /// makes it possible to transfer the modified text to the window title
    
private slots:
    void    timerHit();
    
};

#endif // MYMODEL_H
